package cn.bgs.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/*
@Auther ysr  
@Date 2021/7/16
@Time 10:16
*/
public class DateString {
    public static String getDateString(Date date, Boolean time){
        String dateString;
        if(time==true) {
            SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            dateString=sd.format(date);
        }else{
            SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
            dateString=sd.format(date);
        }
        return dateString;
    }
}
